package com.yhn.testIO;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author 岳浩楠
 * @Date 2024-05-30 20:23
 * @Version 1.0
 * 该类用于测试Map集合的遍历
 */
public class MapTest {

    public static void main(String[] args) {
        Map<String, String> map = new HashMap();

        map.put("1", "宋江");
        map.put("2", "林冲");
        map.put("3", "程咬金");


        for (Map.Entry<String, String> item : map.entrySet()) {
            String key = item.getKey();
            String value = item.getValue();
            System.out.println("key = " + key);
            System.out.println("value = " + value);
        }

    }
}
